//
//  DocumentViewController.m
//  Village
//
//  Created by longrise on 2017/10/30.
//  Copyright © 2017年 程虎. All rights reserved.
//

#import "DocumentViewController.h"
#import <QuickLook/QuickLook.h>


@interface DocumentViewController ()<UIWebViewDelegate>
@property (nonatomic ,strong)UIWebView *web;

@end

@implementation DocumentViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.title = _name;
    [MBProgressHUD showMessage:@"正在加载..." toView:self.navigationController.view];
    _web = [[UIWebView alloc] initWithFrame:CGRectMake(0, 0, kDeviceWidth, KDeviceHeight - 64)];
    _web.delegate = self;
    _web.scalesPageToFit = YES;
    NSURL* url = [NSURL URLWithString:_url];//创建URL
    NSURLRequest* request = [NSURLRequest requestWithURL:url];//创建NSURLRequest
    [_web loadRequest:request];
    [self.view addSubview:_web];
}
-(void)webViewDidFinishLoad:(UIWebView *)webView
{
    [MBProgressHUD hideHUDForView:self.navigationController.view];
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}
/*
#pragma mark - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/
@end
